package com.sky.mapper;
import com.sky.vo.DishItemVO;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 套餐-菜品关联表mapper层
 * @className SetmealDishMapper
 * @description SetmealDishMapper
 * @auth xxk
 * @date 2025/7/10
 */
@Mapper
public interface SetmealDishMapper extends BaseMapper<SetmealDish> {


    /**
     * 根据ids查询
     * @param dishIds
     * @return SetmealDish
     * @description description
     */
    List<Long> selectByDishIds(List<Long> dishIds);

    /**
     * 根据dishId查找setmealId，即查找包含某菜品的套餐id
     * @param dishId
     * @return List<Long>
     * @description description
     */
    List<Long> getSetmealIdsByDishId(Long dishId);

    int insertList(@Param("list")List<SetmealDish> list);

    int deleteBySetmealId(@Param("setmealId")Long setmealId);

    SetmealDish selectById(@Param("id")Long id);

    List<SetmealDish> selectBySetmealId(@Param("setmealId")Long setmealId);


    /**
     * 根据套餐id查询关联的菜品
     * @param id
     * @return List<DishItemVO>
     * @description description
     */
    List<DishItemVO> getDishItemBySetmealId(Long id);
}
